<?php
//
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
if($_RQ['op']=='main'){
	$params = array('type'=>0);
	$return['list']=array();
	$return['params']=$params;
	set_html('title','我领取的兑换券');
	exi($return);
}
if($_RQ['op']=='getlist'){
	$params = array('uniacid'=>$_SESSION['uniacid'],'smid'=>$_SESSION['uid'],'status >'=>0);
	if($_RQ['type']==1){
		$params['isuse']=0;
	}
	if($_RQ['type']==2){
		$params['isuse']=1;
	}
	$return['type']=$_RQ['type'];
	$pindex = max(1, intval($post['page']));
	$psize = 10;
	$total='';
	$list=pdo_getslice('jy_sendgoods_ex_log',$params,array($pindex,$psize),$total,$fields,'','createtime desc');
	foreach($list as &$row){
			$row['order']=pdo_get('jy_sendgoods_order',array('id'=>$row['order_id']));
			$row['goods']=pdo_get('jy_weishop_goods',array('id'=>$row['order']['goodsid']));
			$row['option_title']=pdo_getcolumn('jy_weishop_goods_option',array('id'=>$row['order']['optionid']),'title');
	}
	$return['list']=$list;
	$return['ntime']=time();
	
	exi($return);
}
?>